
from sqlobject import *
import sys, os
#import time


connection = connectionForURI('sqlite:' + os.path.abspath('db/atasko2.sqlite'))
sqlhub.processConnection = connection

class Person(SQLObject):
    alias = StringCol(alternateID=True)
    name = StringCol()
    email = StringCol()
    Phone = StringCol(default=None)
    ip = StringCol(length=15,default=None)
    canSend = BoolCol(default=True)
    canReceive = BoolCol(default=True)
    photo = StringCol(default=None)
    myself = BoolCol(default=False)


class Task(SQLObject):
    creator_id = ForeignKey('Person')
    worker_id = ForeignKey('Person')
    title = StringCol()
    memo = StringCol(default='')
    date_new = DateTimeCol(default=DateTimeCol.now)
    date_mod = DateTimeCol(default=DateTimeCol.now)
    date_end = DateTimeCol(default=None)	
    st_work = StringCol(default=None)
    st_transfer= StringCol(default=None)	


    